<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    function Person(name,age){
         this.name = name
         this.age = age;

     }
     function Student(grade){
         this.grade = grade;
        
    }
   
     var p=new Person('谢谢',18);
     Student.prototype=p;
     var s=new Student(2);

     console.log(s.name);
  function Animal(name,leg){
        this.name = name;
        this.leg = leg;

    }
    function Dark(eat){
      this.eat = eat;

    }
   
    var a=new Animal('gaga',4);
    Dark.prototype=a;
    var c=new Dark(2);
    console.log(c.name);
    </script>
</body>
</html>